package com.cy.pj.common.pojo;

import java.io.Serializable;

import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 基于此对象封装服务器端要响应到客户端的数据                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
 * @author Administrator
 *
 */
@Data
@NoArgsConstructor	//无参构造
public class JsonResult implements Serializable{


	private static final long serialVersionUID = 677048178703375661L;
	
	private Integer state=1;
	private String message="ok";
	private Object data;
	
	public JsonResult(String message){
		this.message=message;
	}
	public JsonResult(Object data){
		this.data=data;
	}
	public JsonResult(Throwable e) {	//Throwable为所有异常的父类
		this.state=0;
		this.message=e.getMessage();
	}
}
